#!/bin/sh

if [ -z "$LMD_BASE_INSTALL_SCRIPT_DIR" ]; then
   echo "Error: Env LMD_BASE_INSTALL_SCRIPT_DIR is not defined."
   exit 1
else 
   echo "Env LMD_BASE_INSTALL_SCRIPT_DIR: "$LMD_BASE_INSTALL_SCRIPT_DIR
fi

CURRENT_APP_SCRIPT_PATH=${LMD_BASE_INSTALL_SCRIPT_DIR}/apps/chatbox-ai

# env file path
ENV_FILE=$CURRENT_APP_SCRIPT_PATH/env
echo $ENV_FILE

# check env file
if [ ! -f "$ENV_FILE" ]; then
    echo "Error env dose not exist."
    exit 1
fi

set -a # auto export vars
source "$ENV_FILE"
set +a # close auto export